<%--
  Created by IntelliJ IDEA.
  User: c
  Date: 2017-11-18
  Time: 15:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/WEB-INF/jsp/header.jsp"%>
</head>
<style>
    table td{
        font: 14px 'microsoft yahei', 微软雅黑, Helvetica, Arial, Tahoma, 黑体, 宋体, sans-serif;
    }
</style>
<body>
    <div style="margin-top: 18px;" class="container-fluid" width="80%">
        <div style="text-align: center">
            <span class="h3">药品采购计划登记</span>
        </div>
        <form class="submit" class="form-inline">
            <input type="hidden" name="planNum" value=""/>
            <table id="delTable" style="margin-top: 18px;" class="table table-bordered ">
                <tr >
                    <td colspan="3">
                        <%--<label class="control-label">供应商(药商)：</label>--%>
                            <div class="form-inline">
                                <label class=" control-label">供应商(药商)：</label>
                                <div class="input-group">
                                   <%-- <select style="width:250px;" class="form-control" id="proNum" name="proNum" value="${pur.proNum}">
                                        <option value="-1">--请选择--</option>
                                    </select>--%>
                                    <input name="" readonly="readonly" class="form-control" value="${pur.provider.proName}"/>
                                </div>
                            </div>
                    </td>
                    <td colspan="2">
                        <div class="form-inline">
                            <label class=" control-label">预定采购日期：</label>
                            <div class="form-group">
                                <fmt:formatDate value="${pur.planDate}" pattern="yyyy-MM-dd" var="date"/>
                                <input type="text" class="form-control" name="planDate" value="${date}"/>
                            </div>
                        </div>
                    </td>
                    <td colspan="2">
                        <div class="form-inline">
                            <label class=" control-label">采购员：</label>
                            <div class="input-group">
                               <%-- <select class="form-control" id="woJubnum" name="woJubnum">
                                    <option value="-1">--请选择--</option>
                                </select>--%>
                                   <input name="" readonly="readonly" class="form-control" value="${pur.worker.woName}"/>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr id="back">
                    <th>序号</th>
                    <th>药品名称</th>
                    <th>购进价格</th>
                    <th>批发价格</th>
                    <th>零售价格</th>
                    <th>购进数量</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${list}" var="del">
                    <tr>
                        <td>${del.delId}</td>
                        <td>${del.druginfo.drugName}</td>
                        <td>${del.delBuyprice}</td>
                        <td>${del.delRetailprice}</td>
                        <td>${del.delOneprice}</td>
                        <td>${del.delBuynum}</td>
                        <td>
                            <button type="button" class="layui-btn layui-btn-mini edit" onclick="updateDrug(this)">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-mini delete" onclick="deleteDels(this)">删除</button>
                        </td>
                    </tr>
                </c:forEach>
                <tr>
                    <td colspan="3">
                       <label class="control-label pull-right" style="font-size: 16px; line-height: 94px;">备注：</label>
                    </td>
                    <td colspan="4">
                        <textarea placeholder="请输入备注内容" class="layui-textarea" name="planRemark">${pur.planRemark}</textarea>
                    </td>
                </tr>
            </table>
            <div style="text-align: center;">
                <button class="btn btn-success" onclick="subPurZhu()" type="button">提交审核</button>
                &nbsp;&nbsp;
                <button class="btn btn-primary" onclick="" type="button">返回</button>
            </div>
            <div style="text-align: center; margin-top: 10px;">
                <span style="color: red;" class="zhuErr">

                </span>
            </div>
        </form>

        <div id="updateDrug">
            <form action="" id="purDelForm" class="form-horizontal">
                <input type="hidden" name="delId" value=""/>
                <input type="hidden" name="drugNum" value=""/>
                <input type="hidden" name="planNum" value=""/>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">药品名称：</label>
                    <div class="form-group col-md-6">
                        <input type="text" name="drugName" readonly="readonly" class="form-control" value=""/>
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">购进价格：</label>
                    <div class="form-group col-md-5">
                        <input type="text" onblur="checkdelBuyprice()" onfocus="" name="delBuyprice" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkdelBuyprice"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">批发价格：</label>
                    <div class="form-group col-md-5">
                        <input type="text" onblur="checkdelRetailprice()" name="delRetailprice" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkdelRetailprice"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">零售价格：</label>
                    <div class="form-group col-md-5">
                        <input type="text" onblur="checkdelOneprice()" name="delOneprice" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkdelOneprice"></span>
                    </p>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">现有数量：</label>
                    <div class="form-group col-md-5">
                        <input type="text" readonly="readonly" name="delQoh" class="form-control" value="">
                    </div>
                </div>
                <div class="form-group">
                    <label for="" class="control-label col-md-3">购进数量：</label>
                    <div class="form-group col-md-5">
                        <input type="text" name="delBuynum" onblur="checkdelBuynum()" class="form-control">
                    </div>
                    <p class=" col-md-4" style="line-height: 34px; ">
                        <i style="color: red;">*</i>
                        <span class="checkdelBuynum" ></span>
                    </p>
                </div>
            </form>
        </div>

    </div>
    <%@include file="/WEB-INF/jsp/footer.jsp"%>
    <script src="${ctx}/res/js/purEdit.js"></script>
</body>
</html>
